$(function(){ 
  //手机版适配js
  fixViewport();
    
});

function fixViewport()
{
  var metas = document.getElementsByTagName('meta');
  if ((navigator.userAgent.match(/iPhone/i)) || (navigator.userAgent.match(/iPod/i)) || (navigator.userAgent.match(/iPad/i))) {
      for (i=0; i<metas.length; i++) {
          if (metas[i].name == "viewport") { metas[i].content = "width=640, user-scalable=no"; }
      }
  }
  if (navigator.userAgent.match(/android/i)) {
      for (i=0; i<metas.length; i++) {
          if (metas[i].name == "viewport") { metas[i].content = "width=640, target-densityDpi=290, user-scalable=no"; }  //for galaxy s4 & google nexus
      }  
  }

}